-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(ssr): apply ssr props to the the fallback vnode-based branch in ssr #7247
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❌ Deploy Preview for vuejs-coverage failed.
|
edison1105
commented
Feb 23, 2023
@@ -1,5 +1,5 @@ | |||
import { createApp, createVNode } from 'vue' | |||
import { renderToString } from '../src/renderToString' | |||
import { renderToString } from '../src' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change ensure initDirectivesForSSR()
is called in test.
Size ReportBundles
Usages
|
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks good to me.
A couple of observations:
- The test is based on the original issue, which makes it look a bit more complicated than it needs to be. The slot and recursion aren't really necessary to hit the problem. Just a parent template like
<component is="div"><one v-show="false" /></component>
is enough, with a child of<div />
. It took me a while to understand what was going on because of the extra complexity in the test case. - The code is modifying the
vnode
, withvnode.props =
. I'm not sure whether this is potentially a problem. I couldn't find anywhere else in this section of the code that modifies the original VNode like this, though that may just be a coincidence. Maybe there could be a problem if the VNode is reused somehow, or if some other code is expecting to access the unaltered props? Not sure what that would look like in practice, so it may be a non-issue.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
ready to merge
The PR is ready to be merged.
scope: slots
scope: ssr
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
close #6123